package com.yang.sms.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Billyang
 * @date 2024/9/26 18:29
 */
public interface SmsEnum {

    /**
     * 短信业务类型
     */
    @AllArgsConstructor
    enum Type {
        // verifycode:验证码,market:营销活动,tips:提示信息
        VERIFYCODE("verifycode", "验证码"), MARKET("market", "营销活动"), TIPS("tips", "提示信息");

        @Getter
        private String code;
        @Getter
        private String desc;

        public static Type of(String code) {
            for (Type item : Type.values()) {
                if (item.getCode().equals(code)) {
                    return item;
                }
            }
            return null;
        }
    }
}
